package de.szut.ita13sommerfeld.blockadventure.gameentities;

import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.util.LinkedList;
import java.util.Random;

import de.szut.ita13sommerfeld.blockadventure.controller.Controller;
import de.szut.ita13sommerfeld.blockadventure.level.SpawnPoint;
import de.szut.ita13sommerfeld.blockadventure.textures.Texture;
import de.szut.ita13sommerfeld.blockadventure.window.Game;

public abstract class Entity {
	
	protected Texture texture = Game.getTexturesInstance();
	protected Controller controller = Game.getControllerInstance();
	protected Random random = Game.getRandomInstance();
	protected BufferedImage tex;

	protected float x, y;
	protected float width, height;
	protected float velocityX = 0.0f;
	protected float velocityY = 0.0f;
	protected boolean falling , jumping;
	protected SpawnPoint spawnpoint;
	
	public Entity(float x, float y, float width, float height, SpawnPoint spawnpoint) {
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
		this.spawnpoint = spawnpoint;
	}
	
	public abstract void render(Graphics g);
	public abstract void tick(LinkedList<Entity> entities);
	public abstract Rectangle getBounds();
	public abstract Rectangle getBottomBounds(); 
	public abstract Rectangle getBoundsTop();
	public abstract Rectangle getBoundsRight();
	public abstract Rectangle getBoundsLeft();
	
	public float getX() {
		return x;
	}

	public void setX(float x) {
		this.x = x;
	}

	public float getY() {
		return y;
	}

	public void setY(float y) {
		this.y = y;
	}

	public float getVelocityX() {
		return velocityX;
	}

	public void setVelocityX(float velocityX) {
		this.velocityX = velocityX;
	}

	public float getVelocityY() {
		return velocityY;
	}

	public void setVelocityY(float velocityY) {
		this.velocityY = velocityY;
	}

	public SpawnPoint getSpawnpoint() {
		return spawnpoint;
	}

	public void setSpawnpoint(SpawnPoint spawnpoint) {
		this.spawnpoint = spawnpoint;
	}

	public float getWidth() {
		return width;
	}

	public void setWidth(float width) {
		this.width = width;
	}

	public float getHeight() {
		return height;
	}

	public void setHeight(float height) {
		this.height = height;
	}

	public boolean isFalling() {
		return falling;
	}

	public void setFalling(boolean falling) {
		this.falling = falling;
	}

	public boolean isJumping() {
		return jumping;
	}

	public void setJumping(boolean jumping) {
		this.jumping = jumping;
	}	
}
